home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_02_12
/
2n12050a
< prev
next >
Wrap
Text File
|
1991-10-27
|
478b
|
16 lines
Function StrAssign(VAR Dest:PCHAR; Source:PCHAR):PCHAR;
{ Allocate memory and copy existing source to dest. This first
deallocates dest's memory if required. }
begin
if Dest <> NIL then StrDispose(Dest);{ Deallocate Dest }
if (Source = NIL) OR (Source[0] = #0) then
Dest := NIL { No source string so return NIL }
else
begin
GetMem(Dest, StrLen(Source)+1 ); { +1 for the 0 byte }
StrCopy(Dest, Source)
end
end;